<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Identi Engine - Debug Identities</title>

<link rel="stylesheet" href="../css/site.css" type="text/css" media="all" />
<link rel="stylesheet" href="../css/demos.css" type="text/css" media="all" />
<link rel="stylesheet" href="../css/demo-identity-discovery.css" type="text/css" media="all" />	
<link rel="shortcut icon" href="../images/logo16.png"/>


<style type="text/css">
a {
	color: #13ACE8;
	font-weight: bold;
}
</style>

<script language="javascript" type="text/javascript" src="../ident/jquery-1.3.2.min.js"></script>


<script language="javascript" type="text/javascript">

     /*
     *  Copyright 2009, Glenn Jones
     *  Licensed under the MIT license.
     *  http://lab.madgex.com/license
     *  More information: http://lab.madgex.com/identi
     */
    
    // Page functions
    // -------------------------------------------------
    
    var urls = "";
    var useInwardEdges = 0;
    var endPoints = 0;
    var format = "json";
    var iconPath = "";
    
    jQuery(document).ready(function () {
  		jQuery("#subbutton").click(function () {
  
  			if(jQuery("#useInwardEdges").attr("checked"))
  				useInwardEdges = 1;
  				  			 	
  			 if(jQuery("#endPoints").attr("checked"))
  			 	endPoints = 1;

  			for (var i=0; i < document.debug.format.length; i++) 
               if (document.debug.format[i].checked)
                  format = document.debug.format[i].value;
  			
  			urls = jQuery("#urls").attr("value");
  			iconPath = jQuery("#iconPath").attr("value");  			
    
            var query = 'use "http://identengine.com/opentables/identities.xml";select * from identities where urls="' + urls + '" and useInwardEdges=' + useInwardEdges + ' and endPoints=' + endPoints + ' and iconPath="' + iconPath + '";';      
            var apiCall = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent( query ) + '&format=' + format + '&diagnostics=false';
            
            document.location.href = apiCall;
        });
     });  
     
    
</script>


<link type="application/rss+xml" rel="alternate" title="Ident Engine (RSS)" href="http://identengine.com/Blog/syndication.axd?format=rss" />
<link type="application/atom+xml" rel="alternate" title="Ident Engine (ATOM)" href="http://identengine.com/Blog/syndication.axd?format=atom" />

</head>

<body>

	<div class="header">
		<div class="centered">
			<a href="http://identengine.com/"><h1><span>Ident Engine</span></h1></a>
			<h2 id="strapline"><span>A JavaScript library that retrieves and aggregates profiles from across the web</span> </h2>
		</div>
	</div>

	<div class="content">
		<div class="centered">
		<div class="floatclear" style="clear:both">
			<ul class="menu">
				<li><a href="../index.htm" class="firstItem">home</a></li>
				<li><a href="../documentation/index.htm">documentation</a></li>
				<li><a href="index.htm">api</a></li>
				<li><a href="http://identengine.com/blog/">blog</a></li>
				<li><a href="../about/index.htm" class="lastItem">about</a></li>
			</ul>
		</div>	


        <h1>Identities API</h1>
        
        <p  class="restricted-width">
        This Identities API creates a list of found identities and associated service endpoints for a given individual.
        It uses Ident Engine library to wrap Google’s Social Graph API, 
		returning a much richer result 
        set than using Google’s API directly. It is taking advantage of YQL opentable to host the core of the Ident Engine&#39;s JavaScript. 
        </p>
		
		<h2>Try it out...</h2>
        
        <form id="debug" name="debug">
			<p><label for="urls">Profile URL</label>&nbsp;<input id="urls" name="urls" value="http://twitter.com/glennjones" size=50 type="text" /></p>
			<p><input id="useInwardEdges" checked="checked" name="useInwardEdges" type="checkbox" value="1" /> <label for="useInwardEdges">Use inward edges</label></p>
			<p><input id="endPoints" checked="checked" name="endPoints" type="checkbox" value="1" /> <label for="endPoints">End points</label></p>
			<p><label for="iconPath">Icon Path</label>&nbsp;<input id="iconPath" name="iconPath" value="http://identengine/identi/icons/" size=50 type="text" /></p>
			<p><label for="format">Format</label>: <input checked="checked" name="format" value="xml" type="radio" />XML <input name="format" value="json" type="radio" />JSON</p>
			<p><input id="subbutton" type="button" value="submit" /></p>
		</form>	
		
		<h2>Example</h2>
		<p>I have created an <a href="identities-demo.htm">example</a> which demostrates the use of this API.</p>
		
		
		   <h2>API parameters</h2>
		   
		   <p>The parameters &quot;urls&quot;, &quot;useInwardEdges&quot;, &quot;endPoints&quot; and 
		   &quot;iconPath&quot; are used to create the YQL query parameter &quot;q&quot; i.e.</p>
		   
		   <p>
		<strong>
		use "http://identengine.com/opentables/identities.xml"; select * from 
		identities where urls="http://twitter.com/glennjones" and useInwardEdges=1 and&nbsp; endPoints=1 and iconPath="http://identengine/identi/icons/";
		</strong>
		</p>
		

                         <dl>
                            <dt>urls </dt>
                            <dd>A single URL or a comma delimited list of URLs 
							of profiles</dd>
                            <dt>useInwardEdges</dt>
                            <dd>Use inward edges, this maps direclty to the Google 
							Social Graph API &quot;edi&quot; query parameter. Setting this 
							to 1 will return more results, but incease the 
							chance of errors.</dd>
                            <dt>endPoints</dt>
                            <dd>Switches on or off the inclusion of service 
							end point data. </dd>
                            <dt>iconPath</dt>
                            <dd>The path to add to the front of the icon name.</dd>
                            <dt>format</dt>
                            <dd>The YQL output format xml or json.</dd>
                            <dt>diagnostics</dt>
                            <dd>Switches on or off the YQL diagnostics information.</dd>

                        </dl>

		
		
		<h2>YQL query example</h2>
		
		<p>The example URL below showes how to call the API. It only looks 
		complex because of the URL encoding of the YQL query. It has a simple 
		structure really.</p>
		
		<p>
		<a href="http://query.yahooapis.com/v1/public/yql?q=use%20%22http%3A%2F%2Fidentengine.com%2Fopentables%2Fidentities.xml%22%3Bselect%20*%20from%20identities%20where%20urls%3D%22http%3A%2F%2Ftwitter.com%2Fglennjones%22%20and%20useInwardEdges%3D1%20and%20endPoints%3D1%20and%20iconPath%3D%22http%3A%2F%2Fidentengine%2Fidenti%2Ficons%2F%22%3B&amp;format=xml&amp;diagnostics=false">
		http://query.yahooapis.com/v1/public/yql?q=use%20%22http%3A%2F%2Fidentengine.com%2Fopentables%2Fidentities.xml%22%3Bselect%20*%20from%20identities%20where%20urls%3D%22http%3A%2F%2Ftwitter.com%2Fglennjones%22%20and%20useInwardEdges%3D1%20and%20endPoints%3D1%20and%20iconPath%3D%22http%3A%2F%2Fidentengine%2Fidenti%2Ficons%2F%22%3B&amp;format=xml&amp;diagnostics=false</a></p>
		
		
		<h2>Output stucture example</h2>

		
		<p>
		Below is an example of an object/property structure in XML. You can use the 
		query parameter &quot;endPoints&quot; to switch on or off the inclusion of end 
		point data.</p>
		
<pre>
&lt;identity&gt;
	&lt;name&gt;Identica&lt;/name&gt;
	&lt;domain&gt;identi.ca&lt;/domain&gt;
	&lt;username&gt;glennjones&lt;/username&gt;
	&lt;iconUrl&gt;http://identengine/identi/icons/identica.png&lt;/iconUrl&gt;
	&lt;spriteClass&gt;icon-identica&lt;/spriteClass&gt;
	&lt;profileUrl&gt;http://identi.ca/glennjones&lt;/profileUrl&gt;
	&lt;endPoints&gt;
		&lt;endPoint&gt;
			&lt;contentType&gt;Profile&lt;/contentType&gt;
			&lt;schema&gt;hCard&lt;/schema&gt;
			&lt;mediaType&gt;Html&lt;/mediaType&gt;
			&lt;url&gt;http://identi.ca/glennjones&lt;/url&gt;
		&lt;/endPoint&gt; 
		&lt;endPoint&gt;
			&lt;contentType&gt;Status&lt;/contentType&gt;
			&lt;schema&gt;hAtom&lt;/schema&gt;
			&lt;mediaType&gt;Html&lt;/mediaType&gt;
			&lt;url&gt;http://identi.ca/glennjones&lt;/url&gt;
		&lt;/endPoint&gt;
	&lt;/endPoints&gt; 
&lt;identity&gt;
</pre>

        

        <div id="results"></div>
        <div id="rawresults"></div>
        
 		</div>
	</div>
	
	

    <div class="footer">
		<div class="centered">
		
		<div class="copyright">© Copyright Glenn Jones 2009. All Rights Reserved./div>
		
		</div>
	</div>
	
	<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-3021774-6");
pageTracker._trackPageview();
} catch(err) {}</script>

</body>
</html>
